package com.chen.recruit.domain.vo;

import com.chen.recruit.common.enums.ClassroomStatus;
import com.chen.recruit.common.valid.AddGroup;
import com.chen.recruit.common.valid.UpdateGroup;
import com.chen.recruit.domain.model.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("ClassroomVo 教室视图对象")
public class ClassroomVo extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("教室id")
    @Null(message = "新增教室id必须为空", groups = AddGroup.class)
    @NotNull(message = "更新教室id不能为空", groups = UpdateGroup.class)
    private Integer id;

    @ApiModelProperty("所属学院")
    @NotNull(message = "所属学院不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer collegeId;

    @ApiModelProperty("教室名称")
    @NotBlank(message = "教室名称不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String name;

    @ApiModelProperty("教室地点")
    @NotBlank(message = "教室地点不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String place;

    @ApiModelProperty("容纳人数")
    @NotNull(message = "容纳人数不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Min(message = "容纳人数必须为正整数", value = 0)
    private Integer capacity;

    @ApiModelProperty("状态(1占用 0闲置)")
    @NotNull(message = "教室状态不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private ClassroomStatus status;

}
